package cn.hls.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

@Table(name="t_hand_car")
@Entity
@DynamicInsert
@DynamicUpdate
public class HandCar extends BaseEntity {
	private static final long serialVersionUID = -8138130867874302293L;
	private String licenseNum;// 车牌号
	private String color;//车身颜色
	private Integer wheelNum;//车轮数
	private Date productTime;//出厂日期
	private Float totalMass;//总质量
	private Float carryCapacity;//载重量
	private Car car;
	private Long companyId;//挂车对应的承运企业信息
	
	@Column(name = "license_num", length = 8)
	public String getLicenseNum() {
		return licenseNum;
	}

	public void setLicenseNum(String licenseNum) {
		this.licenseNum = licenseNum;
	}

	@Column(name="color",length=8)
	public String getColor() {
		return color;
	}

	public void setColor(String color) {
		this.color = color;
	}

	@Column(name="wheel_num")
	public Integer getWheelNum() {
		return wheelNum;
	}

	public void setWheelNum(Integer wheelNum) {
		this.wheelNum = wheelNum;
	}

	@Column(name="product_time")
	public Date getProductTime() {
		return productTime;
	}

	public void setProductTime(Date productTime) {
		this.productTime = productTime;
	}

	@Column(name="total_mass")
	public Float getTotalMass() {
		return totalMass;
	}

	public void setTotalMass(Float totalMass) {
		this.totalMass = totalMass;
	}
	@Column(name = "carry_capacity")
	public Float getCarryCapacity() {
		return carryCapacity;
	}

	public void setCarryCapacity(Float carryCapacity) {
		this.carryCapacity = carryCapacity;
	}


	@ManyToOne(cascade = CascadeType.REFRESH)
	@NotFound(action = NotFoundAction.IGNORE)
	@JoinColumn(name = "car_id")
	public Car getCar() {
		return car;
	}

	public void setCar(Car car) {
		this.car = car;
	}

	@Column(name="company_id")
	public Long getCompanyId() {
		return companyId;
	}

	public void setCompanyId(Long companyId) {
		this.companyId = companyId;
	}
}

